Skip to content

TINKERPOP-3252 Replace Transaction.open() with idempotent begin()#3471

Merged
kenhuuu merged 1 commit into
masterfrom
remove-txopen
Jun 29, 2026
Merged

TINKERPOP-3252 Replace Transaction.open() with idempotent begin()#3471
kenhuuu merged 1 commit into
masterfrom
remove-txopen

Conversation

@kenhuuu

@kenhuuu kenhuuu commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/TINKERPOP-3252

open() and begin() were redundant ways to start a transaction, and the strict "throw if already open" contract was incompatible with the embedded AUTO behavior: a read opens the transaction implicitly, so a later explicit begin() would throw even though the caller did nothing wrong. Collapsing to a single idempotent begin() makes explicit and implicit opens compose, and gives one consistent transaction-start verb across embedded, remote, and all GLVs.

close() is made idempotent for the same reason — so the common try-with-resources / double-close patterns are safe rather than surprising.

The base AbstractTransaction.begin() now opens via a guarded doOpen() so the contract holds for every provider (not just TinkerGraph) and MANUAL mode is no longer broken in the base class.

VOTE +1

Comment thread docs/src/reference/the-traversal.asciidoc Outdated
Comment thread docs/src/reference/the-traversal.asciidoc Outdated
Comment thread docs/src/upgrade/release-4.x.x.asciidoc Outdated
Comment thread docs/src/upgrade/release-4.x.x.asciidoc Outdated
@kenhuuu kenhuuu force-pushed the remove-txopen branch 2 times, most recently from 393899b to dfe49d3 Compare June 26, 2026 21:53
@xiazcy

xiazcy commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

VOTE +1

open() and begin() were redundant ways to start a transaction, and the
strict "throw if already open" contract was incompatible with the embedded
AUTO behavior: a read opens the transaction implicitly, so a later explicit
begin() would throw even though the caller did nothing wrong. Collapsing to
a single idempotent begin() makes explicit and implicit opens compose, and
gives one consistent transaction-start verb across embedded, remote, and all
GLVs.

close() is made idempotent for the same reason — so the common
try-with-resources / double-close patterns are safe rather than surprising.

The base AbstractTransaction.begin() now opens via a guarded doOpen() so the
contract holds for every provider (not just TinkerGraph) and MANUAL mode is
no longer broken in the base class.

Assisted-by: Claude Code:claude-opus-4-8
@Cole-Greer

Copy link
Copy Markdown
Contributor

VOTE +1

@kenhuuu kenhuuu merged commit 150c1d7 into master Jun 29, 2026
84 of 90 checks passed
@kenhuuu kenhuuu deleted the remove-txopen branch June 29, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants